﻿$(function(){
    var oCD={
        'model':{type:Model,props:[{name:'view',ref:'view'}]},
        'view':{type:View,args:[{ref:'model'}]},
        'controller':{type:Controller,args:[{ref:'model'},{ref:'view'}]}
    }
    
    var _oContainer = new IContainer();
    //	Callback delegate for when context has loaded
	function onContextLoaded(oContext){
		//	Check each bean for a contextSupport Method
		function onEachBean(i,n){
			if(n.onContextSupport){
				//	If it has it call it
				n.onContextSupport();
			}
		}
		
		$.each(oContext.getBeans(),onEachBean);
	}
	
	//	Load the container definition
    _oContainer.load(oCD,onContextLoaded);
	
	
});